package cn.hznc.controller.service.order.logic;

import cn.hznc.vo.BomParamVo;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Administrator
 * @Date 2023/3/22 11:16
 */
@Getter
@Setter
public class OrderBomDo {
    private List<BomParamVo> createElement= new ArrayList<>();
    private List<BomParamVo> updateElement= new ArrayList<>();
    private List<BomParamVo> totalElement= new ArrayList<>();

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(BomParamVo element){
        return createElement.add(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(List<BomParamVo> element){
        return createElement.addAll(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addUpdateElement(BomParamVo element){
        return updateElement.add(element);
    }

    /**
     * 添加所有元素
     *
     * @return
     */
    public boolean addAllElement(){
        totalElement.addAll(createElement);
        totalElement.addAll(updateElement);
        return Boolean.TRUE;
    }
}
